<th:block layout:decorator="layout/accountLayout" layout:fragment="content">
    <div th:unless="${responseEvent}" class="manage-account-form-wrapper">
    
        <h2><span th:utext="#{account.giftCard.title}">Enter Gift Card Number:</span></h2>
        <div th:unless="${validGiftCardNumber}" th:inline="text" >
            <p><span class="error_long" style="width: auto; margin: 20px 10px;" th:utext="#{account.giftCard.invalid.number}">Gift Card Number not found.</span></p>
        </div>
        <div th:if="${alreadyRedeemedGiftCard}" th:inline="text" >
            <p><span class="error_long" style="width: auto; margin: 20px 10px;" th:utext="#{account.giftCard.already.redeemed}">Gift Card already redeemed</span></p>
        </div>
    
        <blc:form class="manage-account" th:object="${giftCardInfoForm}" th:action="@{/account/giftcard/redeem}" method="post" id="redeem_giftCard_info">
            <div>
                <div class="form50">
                    <label for="giftCardNumber" class="prompt"><span th:utext="#{cart.giftCardNumber}">Gift Card Number</span></label>
                    <span class="error_long" th:if="${#fields.hasErrors('giftCardNumber')}" th:errors="*{giftCardNumber}"></span>
                    <div class="form100">
                        <input type="text" th:field="*{giftCardNumber}" id="giftCardNumber" class="field35" th:classappend="${#fields.hasErrors('giftCardNumber')}? 'fieldError'"/>
                    </div>
                </div>
    
                <div>
                    <input type="submit" class="medium red" th:value="#{cart.giftCard.apply}" />
                </div>
            </div>
        </blc:form>
    </div>
    
    
    <ul id="redeem-giftcard" th:if="${responseEvent}" th:object="${giftCardAccount}" th:inline="text">
        <li>
            <span class="giftcard-number" th:utext="#{account.giftCard.giftcard.number}">Gift Card Number</span>
            <span class="submit-date" th:utext="#{account.giftCard.date}">Date</span>
            <span class="status" th:utext="#{account.giftCard.status}">Status</span>
            <span class="balance" th:utext="#{account.giftCard.amountApplied}">Amount Applied</span>
        </li>
        <li class="giftcard">
            <div class="giftcard-info-row">
                <span class="giftcard-number" th:utext="*{accountNumber}"/>
                <span class="submit-date" th:utext="${#dates.format(responseEvent.eventDate, 'MM-dd-yyyy')}"></span>
                <span class="status" th:utext="${responseEvent.reasonDesc}">Pending</span>
                <span class="balance" blc:price="${responseEvent.amount}"></span>
            </div>
        </li>
    </ul>
    
    <div class="clearfix"></div>
</th:block>